package j.framework.core;

/**
 * User: jason
 * Date: 2014/11/7 10:31
 */
public class MemberStatus<T> {
    /**
     * 一切正常，可以登录系统
     */
    public static final int OK = 0;
    /**
     * 没有该用户
     */
    public static final int NO_USER = 1;
    /**
     * 密码错误，这种情况，用户是存在的，只是密码错了
     */
    public static final int USER_PASSWORD_ERROR = 2;
    /**
     * 账户被锁定了，如密码连错3次就锁定账户
     */
    public static final int LOCKED = 3;
    /**
     * 账户被禁用了
     */
    public static final int DISABLED = 4;

    public final int memberStatus;
    public final String message;

    public MemberStatus(int status,String message){
        this.memberStatus = status;
        this.message = message;
    }

    private T member;
    public T getMember() {
        return member;
    }
    public void setMember(T member) {
        this.member = member;
    }
    @Override
    public String toString() {
        return String.format("[状态码:%s]%s.", memberStatus,this.message);
    }
}
